<p>When logging a message there are several important requirements which must be fulfilled:</p>
<ul>
  <li> The user must be able to easily retrieve the logs </li>
  <li> The format of all logged message must be uniform to allow the user to easily read the log </li>
  <li> Logged data must actually be recorded </li>
  <li> Sensitive data must only be logged securely </li>
</ul>
<p>If a program directly writes to the standard outputs, there is absolutely no way to comply with those requirements. That’s why defining and using a
dedicated logger is highly recommended.</p>
<h2>Noncompliant Code Example</h2>
<pre>
System.out.println("My Message");  // Noncompliant
</pre>
<h2>Compliant Solution</h2>
<pre>
logger.log("My Message");
</pre>
<h2>See</h2>
<ul>
  <li> <a href="https://wiki.sei.cmu.edu/confluence/x/nzdGBQ">CERT, ERR02-J.</a> - Prevent exceptions while logging data </li>
</ul>

